home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-15 | 7.9 KB | 257 lines | [TEXT/MPS ] |
- //
- // myResList.r
- //
- // This installer script source demonstrates use of Resource List atoms.
- //
- // NOTE: This example uses pre-4.0 method for creating Custom Install options.
- // It is not intended as an example of how to use 4.0 User Interface features.
- //
- //
- // mark young • 08/18/94
- //
- // Copyright 1993-1994, Apple Computer, Inc., All Rights Reserved
- //
-
- #include "InstallerTypes.r"
-
- // • packages
-
- resource 'inpk' (100) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "ResList - add 'vers' ( 3 ) to TeachText ( tgt req'd ) on root of tgt volume.",
- {
- // even though this is within an 'inr#' you should specify 'inra'
- 'inra', 9000; // this ID is the same as the first field
- // for the desired item record in the 'inr#'
- },
- }
- };
-
- resource 'inpk' (200) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "ResList - add 'vers' ( 4 ) to TeachText ( no tgt req'd ) on root of tgt vol.",
- {
- // even though this is within an 'inr#' you should specify 'inra'
- 'inra', 9001; // this ID is the same as the first field
- // for the desired item record in the 'inr#'
- },
- }
- };
-
- resource 'inpk' (300) {
- format0 {
- showsOnCustom,
- removable,
- dontForceRestart,
- 0,
- 0,
- "ResList - add 'vers' ( 5 ) to TeachText ( no tgt req'd ) on root of tgt vol.",
- {
- // even though this is within an 'inr#' you should specify 'inra'
- 'inra', 9002; // this ID is the same as the first field
- // for the desired item record in the 'inr#'
- },
- }
- };
-
-
- // • ResList atoms
-
- // NOTE - in this example resource list atom ( 'inr#' ), all resource
- // items are contained in the same source file, and all resource items
- // will be installed to the same target file.
-
- // If you wish to store different resource items contained in the
- // resource list atom in different source files, just declare the
- // appropriate 'infs' spec for each source file and designate the
- // different source files for each resource item in its section
- // of the 'inr#'
-
- // If you wish to install different resource items contained in the
- // resource list atom to different target files, just declare the
- // appropriate 'intf' spec for each target file and designate the
- // different target files for each resource item in its section
- // of the 'inr#'
-
- // IMPORTANT SAFETY TIP :
- // The first resource item below specifies the flag 'tgtRequired' and
- // will generate an installation error if the target file "TeachText"
- // does not already exist on the root folder of the tgt volume.
-
- // The other resource items specify the flag 'noTgtRequired' and will
- // create a bogus copy of "TeachText" on the root folder of the tgt
- // volume that contains only the resource items just installed. It
- // will NOT generate an installation error. Scriptwriters should take
- // care when specifying 'noTgtRequired' during resource installation.
-
- // ResList atom for source >> TeachText on root folder of tgt volume
- resource 'inr#' (1000) { // use any unique ID,
- // this ID will not be referenced
-
- // NOTE: The resource ID for the ResList resource ( 'inr#' )
- // is treated differently than all other installer resource types
- // to be referenced from with a package resource ( 'inpk' ).
-
- // Normally ( as with Resource atoms [ 'inra' ] ), the resource
- // type and the resource ID of the atom are specified within
- // the package contents list. With ResList atoms ( 'inr#' )
- // the ResList resource item is treated as a list of Resource
- // atoms, rather than as a complete unit to be added to packages.
- // When specifying the contents of an 'inr#' from within an 'inpk',
- // specify the resource type 'inra' and the value specified in the
- // first field of the set of fields that represent one resource item
- // within the ResList atom ( 'inr#' ). The first two resource items
- // in this ResList atom, for example, would be added to a package
- // by specifying [ 'inra', 9000 ] and [ 'inra', 9001 ].
-
- // • first resource item in resource list for atom
-
- 9000, // Resource ID listed in 'inpk'
-
- deleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- leaveAloneIfNewer, // ?? this got set as updateEvenIfNewer = ON
-
- noTgtRequired,
- updateExisting,
- copyIfNewOrUpdate,
- dontIgnoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
-
- 0, // Size of Resource Item
- 10000, // TARGET - file spec ( 'intf' )
- 10000, // SOURCE - file spec ( 'infs' )
- 'vers', // Resource Item Type ( source and target )
- 3, // Resource Item ID ( source and target )
- 0, // Resource Item Attributes
-
- 0x0, // Source Version Number - BCD format
- 0, // Version Compare Proc ID
- 0, // Atom Extender ID ( not currently supported )
- 0, // TARGET - size of resource
-
-
- // • next resource item in resource list for atom
-
- 9001, // Resource ID listed in 'inpk'
-
- deleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- leaveAloneIfNewer, // ?? this got set as updateEvenIfNewer = ON
-
- noTgtRequired,
- updateExisting,
- copyIfNewOrUpdate,
- dontIgnoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
-
- 0, // Size of Resource Item
- 10000, // TARGET - file spec ( 'intf' )
- 10000, // SOURCE - file spec ( 'infs' )
- 'vers', // Resource Item Type ( source and target )
- 3, // Resource Item ID ( source and target )
- 0, // Resource Item Attributes
-
- 0x0, // Source Version Number - BCD format
- 0, // Version Compare Proc ID
- 0, // Atom Extender ID ( not currently supported )
- 0, // TARGET - size of resource
-
-
- // • next resource item in resource list for atom
-
- 9002, // Resource ID listed in 'inpk'
-
- deleteWhenRemoving,
- dontDeleteWhenInstalling,
- copy,
- leaveAloneIfNewer, // ?? this got set as updateEvenIfNewer = ON
-
- noTgtRequired,
- updateExisting,
- copyIfNewOrUpdate,
- dontIgnoreProtection,
- srcNeedExist,
- byID,
- nameNeedNotMatch,
-
- 0, // Size of Resource Item
- 10000, // TARGET - file spec ( 'intf' )
- 10000, // SOURCE - file spec ( 'infs' )
- 'vers', // Resource Item Type ( source and target )
- 3, // Resource Item ID ( source and target )
- 0, // Resource Item Attributes
-
- 0x0, // Source Version Number - BCD format
- 0, // Version Compare Proc ID
- 0, // Atom Extender ID ( not currently supported )
- 0, // TARGET - size of resource
- }}
- };
-
-
- // • file specs
-
-
- // target file spec for TeachText application on root of target volume
- // NOTE: When a target spec is called from within a resource atom of
- // any kind ( 'inra', 'inrm', 'inr#' ), the type, creator, dates and
- // Finder attributes fields will only apply when creating a new file.
- resource 'intf' (10000) {
- format1 {
- noSearchForFile, // use default search path
-
- TypeCrMustMatch, // If this is set to TypeCrMustMatch
- // then a file with a different type
- // and creator than those specified
- // below will not be updated.
- // If this is set to TypeCrNeedNotMatch
- // then type and creator of an existing
- // target file are ignored.
-
- // The Type and Creator fields will be used to set the
- // file's Type and Creator when a new file is created.
- 'APPL', // TYPE for new file
- 'ttxt', // CREATOR for new file
-
- 0, // finder attribute flags
- // filled by ScriptCheck is value is 0
-
- 1, // creation date for new file
- 1, // modification date for new file
- // NOTE: DATE values are filled
- // by ScriptCheck if the value is 1
-
- 0, // search proc ID ( 'insp' ), none used
-
- ":TeachText" // path to target file
- }
- };
-
- // shared source file spec for ResMerge source file
- resource 'infs' (10000) {
- 'rsrc', // TYPE for source file
- 'RSED', // CREATOR for source file
- 0x1, // creation DATE for source file
- noSearchForFile, // IGNORED in Installer 4.0.x
- TypeCrMustMatch, // TYPE, CREATOR must match file on install disk
- "Disk 1:ResListSource.rsrc" // PATH to source file
- };
-
-